#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtNetwork>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void connectAll();
    void disconnectAll();
    void initNetwork();

private:
    Ui::MainWindow *ui;
//    QNetworkConfigurationManager manager;
//    QNetworkSession *session;
    QTcpSocket systemSock;
    QTcpSocket commandSock;
    QTcpSocket videoSock;
    QTcpSocket audioSock;
    QString hostAddr;
    int systemPort;
    int commandPort;
    int videoPort;
    int audioPort;

    void initSockSingnals(QTcpSocket *sock);
public slots:
    void connected();
    void disconnected();
    void error(QAbstractSocket::SocketError error);
    void send();
    void read();
};

#endif // MAINWINDOW_H
